<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>

  <body>
    <script>
      //屏幕宽度
      var x = screen.width;
      //屏幕高度
      var y = screen.height;
      //屏幕可用高度
      var max_x = screen.availHeight;
      //窗口屏幕颜色深度
      var colorDepth = screen.colorDepth;
      //窗口屏幕像素深度
      var pixelDepth = screen.pixelDepth;
      document.write(
        "屏幕宽度：" +
          x +
          "<br>" +
          "屏幕高度：" +
          y +
          "<br>" +
          "屏幕可用高度：" +
          max_x +
          "<br>" +
          "窗口屏幕颜色深度：" +
          colorDepth +
          "<br>" +
          "窗口屏幕像素深度：" +
          pixelDepth
      );
    </script>
  </body>
</html>
